Method and device for obtaining a second image from a first image when the dynamic range of the luminance of the first image is greater than the dynamic range of the luminance of the second image

ABSTRACT

The present disclosure relates to a method and device for obtaining a second image from a first image when the dynamic range of the luminance of the first image is greater than the dynamic range of the luminance of the second image. The disclosure describes deriving at least one component representative of the colors of the second image from the first image, and maximizing at least one derived component according to a maximum value depending on a linear-light luminance component of the first image.

1. REFERENCE TO RELATED EUROPEAN APPLICATION

This application is a continuation of U.S. patent application Ser. No.16/170,853, titled “METHOD AND DEVICE FOR OBTAINING A SECOND IMAGE FROMA FIRST IMAGE WHEN THE DYNAMIC RANGE OF THE LUMINANCE OF SAID FIRSTIMAGE IS GREATER THAN THE DYNAMIC RANGE OF THE LUMINANCE OF SAID SECONDIMAGE” and filed Oct. 25, 2018, which claims priority from EuropeanPatent Application No. EP 17306493.2 titled “METHOD AND DEVICE FOROBTAINING A SECOND IMAGE FROM A FIRST IMAGE WHEN THE DYNAMIC RANGE OFTHE LUMINANCE OF SAID FIRST IMAGE IS GREATER THAN THE DYNAMIC RANGE OFTHE LUMINANCE OF SAID SECOND IMAGE” and filed on Oct. 31, 2017, thecontents of each of which are hereby incorporated by reference in theirentirety.

2. FIELD

The present principles generally relate to image/video processing.Particularly, but not exclusively, the technical field of the presentprinciples are related to converting an image to another image whoseluminance does not belong to a same dynamic range.

3. BACKGROUND

The present section is intended to introduce the reader to variousaspects of art, which may be related to various aspects of the presentprinciples that are described and/or claimed below. This discussion isbelieved to be helpful in providing the reader with backgroundinformation to facilitate a better understanding of the various aspectsof the present principles. Accordingly, it should be understood thatthese statements are to be read in this light, and not as admissions ofprior art.

In the following, an image contains one or several arrays of samples(pixel values) in a specific image/video format which specifies allinformation relative to the pixel values of an image (or a video) andall information which may be used by a display and/or any other deviceto visualize and/or decode an image (or video) for example. An imagecomprises a first component, in the shape of a first array of samples,representative of the luma or luminance of the image, and, possibly, asecond and a third component. In the shape of arrays of samples,representative of the colors (chroma) of the image.

Standard-Dynamic-Range images (SDR images) are images whose luminancevalues are represented with a limited number of bits (most often 8 or10). This limited representation does not allow correct rendering ofsmall signal variations, in particular in dark and bright luminanceranges. In high-dynamic range images (HDR images), the signalrepresentation is extended in order to maintain a high accuracy of thesignal over its entire range. In HDR images, pixel values representingluminance levels are usually represented in floating-point format(either 32-bit or 16-bit for each component, namely float orhalf-float), the most popular format being openEXR half-float format(16-bit per RGB component, i.e. 48 bits per pixel) or in integers with along representation, typically at least 16 bits.

In the following, the term “second image I₂” designates an image whoseluminance values are represented with a second number of bits, and theterm “first image I₁” designates an image whose luminance values arerepresented with a first number of bits. The first number of bits, i.e.the dynamic range of the luminance of the image I₁, is greater than thesecond number of bits, i.e. the dynamic range of the luminance of thesecond image I₂.

For example, an image I₁ may be 12-bits image and the second image I₂may be an 8-bits image, or an image I₁ may be 16-bits image and thesecond image I₂ may be a 12-bits image.

In the following, the capital symbols, for example (C1, C2, C3),designate components of a first image I₁, and lower-case symbols, forexample (c1, c2, c3), designate components of the second image I₂. Primesymbols, in the following, for example

$\left( {{Y^{\prime} = Y^{\frac{1}{\gamma}}},{U^{\prime} = U^{\frac{1}{\gamma}}},{V^{\prime} = V^{\frac{1}{\gamma}}}} \right).$designate gamma-compressed components of a first image I₁ when thoseprime symbols are capital symbols and prime symbols, for example (y′,u′, v′), designate gamma-compressed components of a second image I₂ whenthose prime symbols are lower-case symbols.

Several examples exist to obtain a second image I₂ from a first image I₁when the dynamic range of the luminance of said first image I₁ isgreater than the dynamic range of the luminance of said second image I₂.

FIG. 1 depicts an example of a method for obtaining a second image I₂from a first image I₁ when the dynamic range of the luminance of saidfirst image I₁ is greater than the dynamic range of the luminance ofsaid second image I₂.

In step 10, a first component c1 of the second image I₂ is obtained byapplying a tone mapping function TM to the first component C1 of thefirst image I₁ in order to reduce the dynamic range of the luminance ofsaid first image I₁.

In step 11, the second and third component c2 and c3 of the second imageI₂ are derived by multiplying the second and third components C2 and C3of the first image I₁ by a scaling factor that depends on the firstcomponent c1 of the second image I₂.

Sometimes, for some specific colors of the first image I₁, the derivedsecond image I₂ produces colors that are more visible in the secondimage I₂ than in the first image I₁.

For example, when the first image I₁ is represented in the RGB colorspace, when the R and G components are neglectable (typically 0)compared to the B component (typically 0.01) in some areas of the firstimage I₁, the first image I₁ will look black or very close to black(with some flavors of blue) and the second image I₂ will look very bluein the same areas.

This may also occur when the B and G components are very low and the Rcomponent low but higher than the B and G components. In that case, thesecond image I₂ will look very red.

There is thus a need to fix this issue that introduces colors in thesecond image I₂ that are more visible in said second image I₂ than inthe first image I₁.

4. SUMMARY

The following presents a simplified summary of the present principles inorder to provide a basic understanding of some aspects of the presentprinciples. This summary is not an extensive overview of the presentprinciples. It is not intended to identify key or critical elements ofthe present principles. The following summary merely presents someaspects of the present principles in a simplified form as a prelude tothe more detailed description provided below.

The present principles set out to remedy at least one of the drawbacksof the prior art with a method and a device for obtaining a second imagefrom a first image when the dynamic range of the luminance of said firstimage is greater than the dynamic range of the luminance of said secondimage. The method comprises:

-   -   deriving at least one component representative of the colors of        said second image from said first image; and    -   maximizing at least one derived component according to a maximum        value depending on a linear-light luminance component of the        first image.

According to an embodiment, the maximum value is proportional to thelinear-light luminance component of the first image.

According to an embodiment, the second image being represented in theYUV color space, the maximum value also depends on a componentrepresentative of the luminance of the second image.

According to an embodiment, the linear-light luminance component beingobtained from gamma-compressed components of the first image, a power of2 is used to linearize said gamma-compressed components even when theyhave been gamma-compressed by using a value different of 2.

According to other of their aspects, the present principles also relateto a method and device for encoding a first image by encoding a secondimage obtained from said first image and metadata, and a computerprogram product comprising program code instructions to execute thesteps of the above method when this program is executed on a computer.

According to yet another of their aspects, the present principles relateto a computer program product comprising program code instructions toexecute the steps of a above method when this program is executed on acomputer.

5. BRIEF DESCRIPTION OF DRAWINGS

In the drawings, examples of the present principles are illustrated. Itshows:

FIG. 1 depicts an example of a method for obtaining a second image froma first image when the dynamic range of the luminance of said firstimage is greater than the dynamic range of the luminance of said secondimage;

FIG. 2 depicts an example of a method for obtaining a second image froma first image when the dynamic range of the luminance of said firstimage is greater than the dynamic range of the luminance of said secondimage in accordance with an example of the present principles;

FIG. 3 shows an end-to-end workflow supporting content production anddelivery to displays having different peak luminance:

FIG. 4 shows a diagram of the sub-steps of an embodiment to decompose avideo V1 in a video V2 and metadata in accordance with an example of thepresent principles;

FIG. 6 shows a diagram of a first embodiment of the method of FIG. 4 ;

FIG. 6 shows a diagram of a second embodiment of the method of FIG. 4 ;

FIG. 7 shows an illustration of a perceptual transfer function;

FIG. 8 shows an example of a piece-wise curve used for mapping;

FIG. 9 shows an example of a curve used for converting back a signal toa linear light domain; and

FIG. 10 shows an example of an architecture of a device in accordancewith an example of present principles.

Similar or same elements are referenced with the same reference numbers.

6. DESCRIPTION OF EXAMPLE OF THE PRESENT PRINCIPLES

The present principles will be described more fully hereinafter withreference to the accompanying figures, in which examples of the presentprinciples are shown. The present principles may, however, be embodiedin many alternate forms and should not be construed as limited to theexamples set forth herein. Accordingly, while the present principles aresusceptible to various modifications and alternative forms, specificexamples thereof are shown by way of examples in the drawings and willherein be described in detail. It should be understood, however, thatthere is no intent to limit the present principles to the particularforms disclosed, but on the contrary, the disclosure is to cover allmodifications, equivalents, and alternatives falling within the spiritand scope of the present principles as defined by the claims.

The terminology used herein is for the purpose of describing particularexamples only and is not intended to be limiting of the presentprinciples. As used herein, the singular forms “a”, “an” and “the” areintended to include the plural forms as well, unless the context clearlyindicates otherwise. It will be further understood that the terms“comprises”, “comprising,” “includes” and/or “including” when used inthis specification, specify the presence of stated features, integers,steps, operations, elements, and/or components but do not preclude thepresence or addition of one or more other features, integers, steps,operations, elements, components, and/or groups thereof. Moreover, whenan element is referred to as being “responsive” or “connected” toanother element, it can be directly responsive or connected to the otherelement, or intervening elements may be present. In contrast, when anelement is referred to as being “directly responsive” or “directlyconnected” to other element, there are no intervening elements present.As used herein the term “and/or” includes any and all combinations ofone or more of the associated listed items and may be abbreviated as“/”.

It will be understood that, although the terms first, second, etc. maybe used herein to describe various elements, these elements should notbe limited by these terms. These terms are only used to distinguish oneelement from another. For example, a first element could be termed asecond element, and, similarly, a second element could be termed a firstelement without departing from the teachings of the present principles.

Although some of the diagrams include arrows on communication paths toshow a primary direction of communication, it is to be understood thatcommunication may occur in the opposite direction to the depictedarrows.

Some examples are described with regard to block diagrams andoperational flowcharts in which each block represents a circuit element,module, or portion of code which comprises one or more executableinstructions for implementing the specified logical function(s). Itshould also be noted that in other implementations, the function(s)noted in the blocks may occur out of the order noted. For example, twoblocks shown in succession may, in fact, be executed substantiallyconcurrently or the blocks may sometimes be executed in the reverseorder, depending on the functionality involved.

Reference herein to “in accordance with an example” or “in an example”means that a particular feature, structure, or characteristic describedin connection with the example can be included in at least oneimplementation of the present principles. The appearances of the phrasein accordance with an example” or “in an example” in various places inthe specification are not necessarily all referring to the same example,nor are separate or alternative examples necessarily mutually exclusiveof other examples.

Reference numerals appearing in the claims are by way of illustrationonly and shall have no limiting effect on the scope of the claims.

While not explicitly described, the present examples and variants may beemployed in any combination or sub-combination.

The present principles are described for obtaining an image but extendsto a sequence of images (video) because each image of the sequence issequentially obtained as described below.

According to the present principles, illustrated in FIG. 2 , the methodof FIG. 1 further comprises maximizing (step 12) at least one component(c2 and/or c3) representative of the colors of the second image I₂according to a maximum value MAX depending on a linear-light luminancecomponent L of the first image I₁.

Maximizing a component of an image according to a maximum value appliesa minimum between the value of said component and the maximum value MAXfor each pixel of said image.

This maximum value MAX represents a higher bound that the component c2and/or c3 can never exceed:c2_(maximised)=min(c2,MAX)c3_(maximised)=min(c3,MAX)

Note, that only one component c2 or c3 may be maximized and when boththe two components c2 and c3 are maximized, the two, maximum values MAXmay be different values.

Moreover, the maximum value MAX may be computed for each pixel of animage and thus depends on the luminance value of each pixel.

In a variant, the maximum value MAX is computed for a sub-set of pixelsand a same value is applied to the pixels of said sub-set of pixels.

In step 13, the linear-light luminance component L is obtained from thecomponents C1, C2 and C3 of the first image I₁.

According to an embodiment of step 13, the components C1, C2 and C3 arethe RGB components. i.e. the first image I₁ is represented in the RGBcolor space. The linear-light luminance component L is then obtained by:

$\begin{matrix}{L = {{A_{1}\begin{bmatrix}R \\G \\B\end{bmatrix}} = {\begin{bmatrix}{al} & {bl} & {cl}\end{bmatrix}\begin{bmatrix}R \\G \\B\end{bmatrix}}}} & (1)\end{matrix}$where (R, G, B) is a triplet of values of the first image I₁ representedin the RGB color space, and A₁=[al bl cl] is the first row ofcoefficients of a conventional 3×3 matrix A=[A₁ A₂ A₃]^(T), A₁, A₂, A₃being 1×3 matrices, used to convert image values represented in a RGBcolor space to image values represented in a YUV color space.

According to another embodiment of step 13, the components C1, C2 and C3are the gamma-compressed RGB components (R′, G′, B′) given by:R′=R ^(1/γ)G′=G ^(1/γ)B′=B ^(1/γ)

with γ a real value, typically 2 or 2.4.

These gamma-compressed components have to be linearized (raised to thepower of γ) to compute the linear-light luminance component L fromequation (1):R=R′ ^(γ)G=G′ ^(γ)B=B′ ^(γ)

Said linearization is easily implementable without requiring largecomputing resource when γ=2, because only a power of 2 is applied to thegamma-compressed components.

However, for other value γ (for example γ=2.4), the implementation ofthe linearization is more complex.

According to a variant, a power of 2 is used to linearized saidgamma-compressed components (R′, G′, B′) when they have beengamma-compressed by using a value different of 2, typically 2.4.

Using power of 2 instead of power of 2.4 have few impact on thelinear-light luminance component L and at the end very few impact on thederived second image I₂.

The maximum value MAX used to maximize a component c2 (respectively c3)representative of the colors of the second image I₂ is obtained byassuming that the linear-light component B (respectively R) relative tothe component C2 (respectively C3) representative of the colors of thefirst image I₁ equals the linear-light component b (respectively r)relative to the component c2 (respectively c3) in order to ensure thatthe derived second image I₂ could never have colors that are morevisible than the first image I₁.

Said maximization of the component c2 (respectively c3) avoids anyunwanted blueish (respectively reddish) colors in the second image I₂.

For example, the maximum value MAX for maximizing the component c2 (B=b)is given by:

$\begin{matrix}{{MAX} = \frac{L - {a_{l}*R} - {b_{l}*G}}{c_{l}}} & \left( {2a} \right)\end{matrix}$

Assuming that the linear-light luminance component L is mainly providedby the B component of the first image I₁ (the R and G components areneglectable) equation (2a) is approximated by:

$\begin{matrix}{{MAX} = \frac{L}{c_{l}}} & \left( {2b} \right)\end{matrix}$

The maximum value MAX is thus proportional to the values of thelinear-light luminance component L.

According to another example, the maximum value MAX for maximizing thecomponent c3 (R=r) is given by:

$\begin{matrix}{{MAX} = \frac{L - {b_{l}*G} - {c_{l}*B}}{a_{l}}} & \left( {3a} \right)\end{matrix}$

Assuming that the linear-light luminance component L is mainly providedby the R component of the first image I₁ (the B and G components areneglectable) equation (3a) is approximated by:

$\begin{matrix}{{MAX} = \frac{L}{a_{l}}} & \left( {3b} \right)\end{matrix}$

The maximum value MAX is thus proportional to the values of thelinear-light luminance component L.

According to an embodiment, the second image I₂ is represented in theYUV color space, i.e. c1=y, c2=u and c3=v.

The u and v components are representative of the second image I₂.

The linear-light component b of the second image I₂ is now given by:

$b = {{M_{3}\begin{bmatrix}y \\u \\v\end{bmatrix}} = {{a_{b}*y} + {b_{b}*u} + {c_{b}*v}}}$with M₃=[a_(b) b_(b) c_(b)] is the third row of coefficients of aconventional matrix M used to convert image values represented in a YUVcolor space to image values represented in a RGB color space.

The matrix M is typically given by:

$M = \begin{bmatrix}{ar} & {br} & {cr} \\{ag} & {bg} & {cg} \\{ab} & {bb} & {cb}\end{bmatrix}$

When the BT.2020 or BT.709 color gamuts are used, the matrix M is givenby:

$M = {\begin{bmatrix}1 & 0 & {cr} \\1 & {bg} & {cg} \\1 & {bb} & 0\end{bmatrix}.}$

When the BT.2020 color gamut is used, the matrix M equals:

$M = \begin{bmatrix}1 & 0 & 1.4746 \\1 & {- 0.16455} & {- 0.57135} \\1 & 1.8814 & 0\end{bmatrix}$

When the BT.709 color gamut is used, the matrix M equals:

$M = \begin{bmatrix}1 & 0 & 1.5748 \\1 & {- 0.18733} & {- 0.46813} \\1 & 1.85563 & 0\end{bmatrix}$

The maximum value is now computed (b=B) by:

$\begin{matrix}{{MAX} = \frac{\frac{L - {a_{l}*R} - {b_{l}*G}}{c_{l}} - {a_{b}*y} - {c_{b}*v}}{b_{b}}} & \left( {4a} \right)\end{matrix}$

The maximum value MAX depends thus the linear-light luminance componentL and the first component y representative of the luminance of thesecond image I₂.

Assuming that the linear-light luminance component L is mainly providedby the B component of the first image I₁ (the R and G components areneglectable) equation (4a) is approximated by:

$\begin{matrix}{{MAX} = \frac{\frac{L}{c_{l}} - {a_{b}*y} - {c_{b}*v}}{b_{b}}} & \left( {4b} \right)\end{matrix}$

The maximum value MAX depends thus the linear-light luminance componentL and the first component y representative of the luminance of thesecond image I₂.

When the BT.709 or BT.2020 color gamuts are considered, equation (4a)becomes:

$\begin{matrix}{{MAX} = \frac{\frac{L - {a_{l}*R} - {b_{l}*G}}{c_{l}} - y}{b_{b}}} & \left( {5a} \right)\end{matrix}$

The maximum value MAX depends thus the linear-light luminance componentL and the first component y representative of the luminance of thesecond image I₂.

Equation (4b) becomes:

$\begin{matrix}{{MAX} = \frac{\frac{L}{c_{l}} - y}{b_{b}}} & \left( {5b} \right)\end{matrix}$

The maximum value MAX depends thus the linear-light luminance componentL and the first component y representative of the luminance of thesecond image I₂.

The linear-light component r of the second image I₂ is now given by:

$r = {{M_{1}\begin{bmatrix}y \\u \\v\end{bmatrix}} = {{a_{r}*y} + {b_{r}*u} + {c_{r}*v}}}$with M₁=[a_(r) b_(r) c_(r)] is the first row of coefficients of theconventional matrix M.

The maximum value is now computed (r=R) by:

$\begin{matrix}{{MAX} = \frac{\frac{L - {b_{l}*G} - {c_{l}*B}}{a_{l}} - {a_{r}*y} - {b_{r}*u}}{c_{r}}} & \left( {6a} \right)\end{matrix}$

The maximum value MAX depends thus the linear-light luminance componentL and the first component y representative of the luminance of thesecond image I₂.

Assuming that the linear-light luminance component L is mainly providedby the R component of the first image I₁ (the B and G components areneglectable) equation 4a is approximated by:

$\begin{matrix}{{MAX} = \frac{\frac{L}{a_{l}} - {a_{r}*y} - {b_{r}*u}}{c_{r}}} & \left( {6b} \right)\end{matrix}$

The maximum value MAX depends thus the linear-light luminance componentL and the first component y representative of the luminance of thesecond image I₂.

When the BT.709 or BT.2020 color gamuts are considered, equation (6a)becomes:

$\begin{matrix}{{MAX} = \frac{\frac{L - {b_{l}*G} - {c_{l}*B}}{a_{l}} - y}{c_{r}}} & \left( {7a} \right)\end{matrix}$

The maximum value MAX depends thus the linear-light luminance componentL and the first component y representative of the luminance of thesecond image I₂.

Equation (6b) becomes:

$\begin{matrix}{{MAX} = \frac{\frac{L}{a_{l}} - y}{c_{r}}} & \left( {7b} \right)\end{matrix}$

The maximum value MAX depends thus the linear-light luminance componentL and the first component y representative of the luminance of thesecond image I₂.

The maximum value MAX relies on the fact that the linear-light luminancecomponent L is mainly provided by the B component, respectively Rcomponent, of the HDR image. i.e. if the R, respectively B, and Gcomponent are neglectable.

If said components are not neglectable, the linear-light luminancecomponent L will be far higher (equation 1).

Consequently, when said components are neglectable, the maximum valueMAX (equations 2b, 3b, 4b, 5b, 6b or 7b) is a relevant value becausemaximizing the components representative of the colors of the secondimage I₂ avoids unwanted colors in block areas of the second image I₂,and when said components become not neglectable, the maximum values MAXreach very high levels (equations 2a, 3a, 4a, 5a, 6a and 7a) leading tono maximization of the components representative of the colors of thesecond image I₂.

This guarantees that the maximization of the components representativeof the colors of the second image I₂ only applies when the linear-lightluminance component L is mainly provided by a single componentrepresentative of the colors of the first image I₁.

The method as described in reference with FIG. 2 may be used in variousapplications when a second image must be obtained from a first image andwhen the dynamic range of the luminance of said first image is greaterthan the dynamic range of the luminance of said second image.

Some applications are those relative to the high-dynamic range contentas defined by the High Efficiency Video Coding (HEVC) standard (ITU-TH.265 Telecommunication standardization sector of ITU (October 2014),series H: audiovisual and multimedia systems, infrastructure ofaudiovisual services—coding of moving video, High efficiency videocoding. Recommendation ITU-T H.265) that enables the deployment of newvideo services with enhanced viewing experience, such as Ultra HDbroadcast services. In addition to an increased spatial resolution,Ultra HD can bring a wider color gamut (WCG) and a higher dynamic range(HDR) than the Standard dynamic range (SDR) HD-TV currently deployed.Different solutions for the representation and coding of HDR/WCG videohave been proposed (SMPTE 2014, “High Dynamic Range Electro-OpticalTransfer Function of Mastering Reference Displays, or SMPTE ST 2084,2014, or Diaz, R., Blinstein, S. and Qu, S. “Integrating HEVC VideoCompression with a High Dynamic Range Video Pipeline”, SMPTE MotionImaging Journal, Vol. 125, Issue 1. February 2016, pp 14-21).

FIG. 3 shows an example of a end-to-end workflow supporting contentproduction and delivery to displays having different peak luminance.

At a pre-processing stage, an incoming video V1 is decomposed in a videoV2 and metadata. The dynamic range of the luminance of said video V1 isgreater than the dynamic range of the luminance of said video V2.

The video V2 is then encoded with any legacy codec and an bitstream iscarried throughout an existing legacy distribution network withaccompanying metadata conveyed on a specific channel or embedded in thebitstream.

Preferably, the video coded is a HEVC codec such as the H265/HEVC codecor H264/AVC (“Advanced video coding for generic audiovisual Services”,SERIES H: AUDIOVISUAL AND MULTIMEDIA SYSTEMS, Recommendation ITU-TH.264, Telecommunication Standardization Sector of ITU, January 2012).

The metadata are typically carried by SEI messages when used inconjunction with an HEVC or H264/AVC codec such as the HEVC ColourRemapping Information (CRI) or Mastering Display Colour Volume (MDCV)SEI message.

The bitstream is decoded and a decoded video V2 is then available for aConsumer Electronics (CE) display.

Next, at a post-processing stage, which is functionally the inverse ofthe pre-processing stage, the video V1 is reconstructed from the decodedvideo V2 and metadata obtained from a specific channel or from thebitstream.

This is a single layer encoding/decoding scheme that is adapted to alldistribution workflows because a single stream may be transmitted(including metadata) while allowing backward compatibility with legacyCE devices.

FIG. 4 shows a diagram of the sub-steps of an embodiment to decomposethe video V1 in the video V2 and metadata in accordance with an exampleof the present principles.

An image of the video V1 is the first image I₁ of FIG. 2 and an image ofthe video V2 is the second image I₂ of FIG. 2 .

Optionally, in step 1 the format of the first image I₁ may be adapted toa specific input format (C1, U′, V′) and in step 2, the format (y′,u′_(maximized), v′_(maximized)) of the second image I₂ may also beadapted to a specific output format.

Said input/output format adaptation steps (1, 2) may include color spaceconversion and/or color gamut mapping. Usual format adapting processesmay be used such as RGB-to-YUV or YUV-to-RGB conversion.BT.709-to-BT.2020 or BT.2020-to-BT.709, down-sampling or up-samplingchroma components, etc. Note that the well-known YUV color space refersalso to the well-known YCbCr in the prior art.

In step 10, a first component c1 of the second image I₂ is obtained bymapping a first component C1 of the first image I₁:c ₁ =TM(C1)with TM being a luminance mapping function.

In step 11, a second and third component u′, v′ of the second image I₂are derived by correcting the first and second components U′, V′according to the first component c₁.

The correction of the chroma components may be maintain under control bytuning the parameters of the mapping. The color saturation and hue arethus under control.

According to an embodiment of step 11, the second and third componentsU′ and V′ are divided by a scaling function β₀(c₁) whose value dependson the first component c₁.

Mathematically speaking, the two first and second components u′, v′ aregiven by:

$\begin{bmatrix}u^{\prime} \\v^{\prime}\end{bmatrix} = {\frac{1}{\beta_{0}\left( c_{1} \right)} \cdot \begin{bmatrix}U^{\prime} \\V^{\prime}\end{bmatrix}}$

Note that β₀ may be a pre-processed colour correction Look-Up-Tableindexed by luminance values.

Optionally, in step 14, the first component c₁ may be adjusted tofurther control the perceived saturation, as follows:c=c ₁−max(0,a·u′+b·v′)where a and b are two pre-defined parameters. As an example, a=0 andb=0.1.

This step 14 allows to control the luminance of the second image I₂ inorder to guarantee the perceived color matching between the colors ofthe second image I₂ and the colors of the first image I1.

The Inventors observe that producing colors that are more visible in thesecond image I₂ than in the first image I₁ may come from the fact thatsecond and third components U′ and V′ are divided by the scalingfunction β₀(c₁) whose value depends on the first component c₁. Thus,because the scaling function β₀(c₁) may be very low when the firstcomponent c₁ is low, multiplying the second component U′ (and V′) by theinverse of said scaling function β₀(c₁) leads to very high values forthose components, resulting in the second image I₂ in which blue colorsappears as positive values of the second component U′ (a.k.a Cb chromacomponent) correspond to the blueish part of the color spectrum, and inwhich red colors appears as positive values of the third component V′(a.k.a Cr chroma component) correspond to the reddish part of the colorspectrum. This is also emphasis by the fact that real implementations ofsuch codec involve approximations (such as integer implementation, LUTinterpolation . . . ).

Those artifacts are removed by maximizing (step 12) at least one of thecomponent u′ and v′ representative of the colors of the second image I₂according to a maximum value MAX as described in FIG. 2 . The components(c, u′_(maximized), v′_(maximized)) form the second image I₂.

According to a first embodiment of the method of FIG. 4 , as illustratedin FIG. 5 , in step 1, the first component C1 of the first image I₁ is alinear-light luminance component L obtained from the RGB component ofthe first image I₁ by:

${C1} = {L = {A_{1}\begin{bmatrix}R \\G \\B\end{bmatrix}}}$

and to derive a second and third component U′, V′ by applying apseudo-gammatization using square-root (close to BT.709 OETF) to the RGBcomponents of the first image I₁:

$\begin{bmatrix}U^{\prime} \\V^{\prime}\end{bmatrix} = {{\begin{bmatrix}A_{2} \\A_{3}\end{bmatrix}\begin{bmatrix}\sqrt{R} \\\sqrt{G} \\\sqrt{B}\end{bmatrix}} \times 1024}$

In step 10, the first component y₁ of the second image I₂ is obtained bymapping said linear-light luminance component L:y ₁ =TM(L)

In step 11, the second and third component u′, v′ of the second image I₂are derived by correcting the first and second components U′, V′according to the first component y₁.

According to a second embodiment of the method of FIG. 4 , asillustrated in FIG. 6 , in step 1, the first component C1 of the firstimage I1 is a component Y′ obtained from the gamma-compressed RGBcomponents of the first image I₁ by:

$Y^{\prime} = {A_{1}\begin{bmatrix}R^{\prime} \\G^{\prime} \\B^{\prime}\end{bmatrix}}$

and to derive a second and third component U′, V′ by applying agammatization to the RGB components of the first image I₁:

$\begin{bmatrix}U^{\prime} \\V^{\prime}\end{bmatrix} = {{\begin{bmatrix}A_{2} \\A_{3}\end{bmatrix}\begin{bmatrix}R^{\prime} \\G^{\prime} \\B^{\prime}\end{bmatrix}}*1024}$where γ may be a gamma factor, preferably equal to 2.4.

Note, the component Y′, which is a non-linear signal, is different ofthe linear-light luminance component L.

In step 10, the first component y′₁ of the second image I₂ is obtainedby mapping said component Y′:y′ ₁ =TM(Y′)

In step 15, a reconstructed component

is obtained by inverse-mapping the first component y′₁:

=ITM(y′ ₁)

where ITM is the inverse of the luminance mapping function TM.

The values of the reconstructed component

belong thus to the dynamic range of the values of the component Y′.

In step 11, a second and third component u′, v′ of the second image I₂are derived by correcting the first and second components U′, V′according to the first component y′₁ and the reconstructed HDR lumacomponent

.

This step 11 allows to control the SDR colors and guarantees theirmatching to the HDR colors.

The correction of the chroma components may be maintain under control bytuning the parameters of the mapping (inverse mapping). The colorsaturation and hue are thus under control. Such a control is notpossible, usually, when a non-parametric perceptual transfer function isused.

According to an embodiment of step 11, the scaling function β₀(y′₁)depends on the ratio of the reconstructed component

over the component y′₁:

${\beta_{0}\left( y_{1}^{\prime} \right)} = {\frac{{{ITM}\left( y_{1}^{\prime} \right)} \cdot \Omega}{y_{1}^{\prime}} = \frac{\hat{Y} \cdot \Omega}{y_{1}^{\prime}}}$

with Ω is constant value depending on the color primaries of the HDRimage (equals to 1.3 for BT.2020 for example).

The luminance mapping function TM is based on a perceptual transferfunction, whose the goal is to convert a component of a first image I₁into a component of a second image I₂, thus reducing the dynamic rangeof the values of their luminance. The values of a component of a secondimage I₂ belong thus to a lower dynamic range than the values of thecomponent of a first image I₁.

Said perceptual transfer function TM uses a limited set of controlparameters.

FIG. 7 shows an illustration of a perceptual transfer function which maybe used for mapping luminance components but a similar perceptualtransfer function for mapping luma components may be used.

The mapping is controlled by a mastering display peak luminanceparameter (equal to 5000 cd/m² in FIG. 7 ). To better control the blackand white levels, a signal stretching between content-dependent blackand white levels is applied. Then the converted signal is mapped using apiece-wise curve constructed out of three parts, as illustrated in FIG.8 . The lower and upper sections are linear, the steepness beingdetermined by the shadowGain and highlightGain parameters respectively.The mid-section is a parabola providing a smooth bridge between the twolinear sections. The width of the cross-over is determined by themidToneWidthAdjFactor parameter.

All the parameters controlling the mapping may be conveyed as metadatafor example by using a SEI message as defined in JCTVC-W0133 to carrythe SMPTE ST 2094-20 metadata.

FIG. 9 shows an example of the inverse of the perceptual transferfunction TM (FIG. 7 ) to illustrate how a perceptual optimized videosignal may be converted back to the linear light domain based on atargeted legacy display maximum luminance, for example 100 cd/m².

On FIG. 1-9 , the modules are functional units, which may or not be inrelation with distinguishable physical units. For example, these modulesor some of them may be brought together in a unique component orcircuit, or contribute to functionalities of a software. A contrario,some modules may potentially be composed of separate physical entities.The apparatus which are compatible with the present principles areimplemented using either pure hardware, for example using dedicatedhardware such ASIC or FPGA or VLSI, respectively a «Application SpecificIntegrated Circuit», «Field-Programmable Gate Array», «Very Large ScaleIntegration», or from several integrated electronic components embeddedin a device or from a blend of hardware and software components.

FIG. 10 represents an exemplary architecture of a device 100 which maybe configured to implement a method described in relation with FIG. 1-9.

Device 100 comprises following elements that are linked together by adata and address bus 101:

-   -   a microprocessor 102 (or CPU), which is, for example, a DSP (or        Digital Signal Processor);    -   a ROM (or Read Only Memory) 103;    -   a RAM (or Random Access Memory) 104;    -   an I/O interface 105 for reception of data to transmit, from an        application; and    -   a battery 106.

In accordance with an example, the battery 106 is external to thedevice. In each of mentioned memory, the word «register» used in thespecification can correspond to area of small capacity (some bits) or tovery large area (e.g. a whole program or large amount of received ordecoded data). The ROM 103 comprises at least a program and parameters.The ROM 103 may store algorithms and instructions to perform techniquesin accordance with present principles. When switched on, the CPU 102uploads the program in the RAM and executes the correspondinginstructions.

RAM 104 comprises, in a register, the program executed by the CPU 102and uploaded after switch on of the device 100, input data in aregister, intermediate data in different states of the method in aregister, and other variables used for the execution of the method in aregister.

The implementations described herein may be implemented in, for example,a method or a process, an apparatus, a software program, a data stream,or a signal. Even if only discussed in the context of a single form ofimplementation (for example, discussed only as a method or a device),the implementation of features discussed may also be implemented inother forms (for example a program). An apparatus may be implemented in,for example, appropriate hardware, software, and firmware. The methodsmay be implemented in, for example, an apparatus such as, for example, aprocessor, which refers to processing devices in general, including, forexample, a computer, a microprocessor, an integrated circuit, or aprogrammable logic device. Processors also include communicationdevices, such as, for example, computers, cell phones, portable/personaldigital assistants (“PDAs”), and other devices that facilitatecommunication of information between end-users.

In accordance with an example of encoding or an encoder, the video V1 ora first image I₁ of V1 is obtained from a source. For example, thesource belongs to a set comprising:

-   -   a local memory (103 or 104), e.g. a video memory or a RAM (or        Random Access Memory), a flash memory, a ROM (or Read Only        Memory), a hard disk;    -   a storage interface (105), e.g. an interface with a mass        storage, a RAM, a flash memory, a ROM, an optical disc or a        magnetic support;    -   a communication interface (105), e.g. a wireline interface (for        example a bus interface, a wide area network interface, a local        area network interface) or a wireless interface (such as a IEEE        802.11 interface or a Bluetooth® interface); and    -   an image capturing circuit (e.g. a sensor such as, for example,        a CCD (or Charge-Coupled Device) or CMOS (or Complementary        Metal-Oxide-Semiconductor)).

In accordance with examples of encoding or encoder, the bitstream and/orthe other bitstream carrying the metadata are sent to a destination. Asan example, one of these bitstream or both are stored in a local orremote memory, e.g. a video memory (104) or a RAM (104), a hard disk(103). In a variant, the bitstreams is sent to a storage interface(105), e.g. an interface with a mass storage, a flash memory, ROM, anoptical disc or a magnetic support and/or transmitted over acommunication interface (105), e.g. an interface to a point to pointlink, a communication bus, a point to multipoint link or a broadcastnetwork.

In accordance with examples, device 100 being configured to implement anencoding method as described above, belongs to a set comprising:

-   -   a mobile device;    -   a communication device;    -   a game device;    -   a tablet (or tablet computer);    -   a laptop;    -   a still image camera;    -   a video camera;    -   an encoding chip;    -   a still image server, and    -   a video server (e.g. a broadcast server, a video-on-demand        server or a web server).

Implementations of the various processes and features described hereinmay be embodied in a variety of different equipment or applications.Examples of such equipment include an encoder, a decoder, apost-processor processing output from a decoder, a pre-processorproviding input to an encoder, a video coder, a video decoder, a videocodec, a web server, a set-top box, a laptop, a personal computer, acell phone, a PDA, and any other device for processing a image or avideo or other communication devices. As should be clear, the equipmentmay be mobile and even installed in a mobile vehicle.

Additionally, the methods may be implemented by instructions beingperformed by a processor, and such instructions (and/or data valuesproduced by an implementation) may be stored on a computer readablestorage medium. A computer readable storage medium can take the form ofa computer readable program product embodied in one or more computerreadable medium(s) and having computer readable program code embodiedthereon that is executable by a computer. A computer readable storagemedium as used herein is considered a non-transitory storage mediumgiven the inherent capability to store the information therein as wellas the inherent capability to provide retrieval of the informationtherefrom. A computer readable storage medium can be, for example, butis not limited to, an electronic, magnetic, optical, electromagnetic,infrared, or semiconductor system, apparatus, or device, or any suitablecombination of the foregoing. It is to be appreciated that thefollowing, while providing more specific examples of computer readablestorage mediums to which the present principles can be applied, ismerely an illustrative and not exhaustive listing as is readilyappreciated by one of ordinary skill in the art: a portable computerdiskette; a hard disk; a read-only memory (ROM); an erasableprogrammable read-only memory (EPROM or Flash memory): a portablecompact disc read-only memory (CD-ROM); an optical storage device; amagnetic storage device; or any suitable combination of the foregoing.

The instructions may form an application program tangibly embodied on aprocessor-readable medium.

Instructions may be, for example, in hardware, firmware, software, or acombination. Instructions may be found in, for example, an operatingsystem, a separate application, or a combination of the two. A processormay be characterized, therefore, as, for example, both a deviceconfigured to carry out a process and a device that includes aprocessor-readable medium (such as a storage device) having instructionsfor carrying out a process. Further, a processor-readable medium maystore, in addition to or in lieu of instructions, data values producedby an implementation.

As will be evident to one of skill in the art, implementations mayproduce a variety of signals formatted to carry information that may be,for example, stored or transmitted. The information may include, forexample, instructions for performing a method, or data produced by oneof the described implementations. For example, a signal may be formattedto carry as data the rules for writing or reading the syntax of adescribed example of the present principles, or to carry as data theactual syntax-values written by a described example of the presentprinciples. Such a signal may be formatted, for example, as anelectromagnetic wave (for example, using a radio frequency portion ofspectrum) or as a baseband signal. The formatting may include, forexample, encoding a data stream and modulating a carrier with theencoded data stream. The information that the signal carries may be, forexample, analog or digital information. The signal may be transmittedover a variety of different wired or wireless links, as is known. Thesignal may be stored on a processor-readable medium.

A number of implementations have been described. Nevertheless, it willbe understood that various modifications may be made. For example,elements of different implementations may be combined, supplemented,modified, or removed to produce other implementations. Additionally, oneof ordinary skill will understand that other structures and processesmay be substituted for those disclosed and the resulting implementationswill perform at least substantially the same function(s), in at leastsubstantially the same way(s), to achieve at least substantially thesame result(s) as the implementations disclosed. Accordingly, these andother implementations are contemplated by this application.

The invention claimed is:
 1. A method comprising: obtaining a secondimage from a first image, wherein a dynamic range of a luminancecomponent of the first image is greater than a dynamic range of aluminance component of the second image, wherein obtaining comprises:deriving a first component of the second image by applying a tonemapping function to a first component of the first image, wherein thefirst component of the first image is representative of a linear lightluminance, and wherein the first component of the second image isrepresentative of a linear light luminance; and deriving, based on thefirst component of the first image, a second component of the secondimage and a third component of the second image by multiplyinginformation representative of a second component of the first image andinformation representative of a third component of the first image,respectively, by a scaling factor that depends on a result of applyingof an inverse tone mapping function to the first component of the secondimage, the inverse tone mapping function being the inverse of the tonemapping function.
 2. The method of claim 1, wherein deriving the secondcomponent of the second image and the third component of the secondimage comprises maximizing the second component of the second image andthe third component of the second image according to a maximum valuedepending on the first component of the second image, wherein themaximum value is proportional to the first component of the secondimage.
 3. The method of claim 2, wherein the second image is representedin YUV color space, and wherein the maximum value further depends on thefirst component of the second image.
 4. The method of claim 1, whereinthe first component of the first image is obtained from gamma-compressedcomponents of the first image, and wherein a power of 2 is used tolinearize the gamma-compressed components when the gamma-compressedcomponents were gamma-compressed using a value different from
 2. 5. Themethod of claim 1, wherein the first image is encoded in a form of thesecond image obtained from the first image and metadata.
 6. Anon-transitory computer-readable storage medium having storedinstructions that, when executed by a processor, cause the processor toperform: obtaining a second image from a first image, wherein a dynamicrange of a luminance component of the first image is greater than adynamic range of a luminance component of the second image, whereinobtaining comprises: deriving a first component of the second image byapplying a tone mapping function to a first component of the firstimage, wherein the first component of the first image is representativeof a linear light luminance, and wherein the first component of thesecond image is representative of a linear light luminance; andderiving, based on the first component of the first image, a secondcomponent of the second image and a third component of the second imageby multiplying information representative of a second component of thefirst image and information representative of a third component of thefirst image, respectively, by a scaling factor that depends on a resultof applying of an inverse tone mapping function to the first componentof the second image, the inverse tone mapping function being the inverseof the tone mapping function.
 7. The non-transitory computer-readablestorage medium of claim 6, wherein deriving the second component of thesecond image and the third component of the second image comprisesmaximizing the second component of the second image and the thirdcomponent of the second image according to a maximum value depending onthe first component of the second image, wherein the maximum value isproportional to the first component of the second image.
 8. A devicecomprising at least one processor and at least one memory having storedinstructions operative, when executed by the at least one processor, tocause the device to: obtain a second image from a first image, wherein adynamic range of a luminance component of the first image is greaterthan a dynamic range of a luminance component of the second image,wherein obtaining comprises: deriving a first component of the secondimage by applying a tone mapping function to a first component of thefirst image, wherein the first component of the first image isrepresentative of a linear light luminance, and wherein the firstcomponent of the second image is representative of a linear lightluminance; and deriving, based on the first component of the firstimage, a second component of the second image and a third component ofthe second image by multiplying information representative of a secondcomponent of the first image and information representative of a thirdcomponent of the first image, respectively, by a scaling factor thatdepends on a result of applying of an inverse tone mapping function tothe first component of the second image, the inverse tone mappingfunction being the inverse of the tone mapping function.
 9. The deviceof claim 8, wherein deriving the second component of the second imageand the third component of the second image comprises maximizing thesecond component of the second image and the third component of thesecond image according to a maximum value depending on the firstcomponent of the second image, wherein the maximum value is proportionalto the first component of the second image.
 10. The device of claim 9,wherein the second image is represented in YUV color space, and whereinthe maximum value further depends on the first component of the secondimage.
 11. The device of claim 8, wherein the first component of thefirst image is obtained from gamma-compressed components of the firstimage, and wherein a power of 2 is used to linearize thegamma-compressed components when the gamma-compressed components weregamma-compressed using a value different from
 2. 12. The device of claim8, further comprising an apparatus for encoding the first image in aform of the second image obtained from the first image and metadata.